#include "FreeAnalysis.h"

#include <FreeEarth/IFreeEarth.h>
#include <x3manager/objptr.h>

#include <iostream>

CFreeAnalysis::CFreeAnalysis()
{
	X3_REGISTER_OBSERVER_OBJECT(Event_FreeEarth_Init, &CFreeAnalysis::Initialize);
}

CFreeAnalysis::~CFreeAnalysis()
{
	x3::unregisterObserver(this);
}

bool CFreeAnalysis::Initialize()
{
	x3::Object<IFreeEarth> p(clsidFreeEarth);

	if (p.valid())
	{
		IRenderContext* pRenderContext = p->GetRenderContext();
		if (pRenderContext && pRenderContext->GetMapNode())
		{
			std::cout << "FreeAnalysis Initialize! " << std::endl;
		}
	}

	return true;
}

bool CFreeAnalysis::Uninitialize()
{
	//std::cout << "Un Initialize! " << std::endl;
	return true;
}
